package gtug.duesseldorf.client.model;

import java.io.Serializable;

public class ClientParticipant implements Serializable {

	private static final long serialVersionUID = 1L;

	private String m_participantId;
	private boolean m_add;

	private ClientWaveId m_waveId;

	/**
	 * private constructor for serialization
	 */
	@SuppressWarnings("unused")
	private ClientParticipant() {
	}

	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("ClientParticipant: participantId=").append(m_participantId)
				.append(m_add ? " Add" : " Remove");
		buf.append(" waveId=").append(m_waveId);
		return buf.toString();
	}

	/**
	 * Add or Remove participant to ClientWave
	 * 
	 * @param participantId
	 * @param waveId
	 * @param add
	 *          true: add participant, false: remove participant
	 */
	public ClientParticipant(String participantId, ClientWaveId waveId,
			boolean add) {
		m_participantId = participantId;
		m_waveId = waveId;
		m_add = add;
	}

	public String getParticipantId() {
		return m_participantId;
	}

	public ClientWaveId getWaveId() {
		return m_waveId;
	}

	public boolean isAdd() {
		return m_add;
	}
}
